package com.example.demo.controller;

import com.example.demo.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/findById")
    public User findById(int id) {
        User user = new User();
        user.setId(1);
        user.setName("张三");
        return user;
    }

    @RequestMapping("/findByAge")
    public User findByAge(int age) {
        User user = new User();
        user.setId(2);
        user.setName("李四");
        user.setAge(20);
        return user;
    }

    @RequestMapping("/findBySex")
    public User findBySex(String sex) {
        User user = new User();
        user.setId(99);
        user.setSex("男");
        user.setName("王五");
        user.setWeight("111111kg");
        return user;
    }
    @RequestMapping("/findByAddress")
    public User findByAdderss(String  address) {
        User user = new User();
        user.setId(2);
        user.setName("李四");
        user.setAge(20);
        user.setAddress("合肥市");
        return user;
    }

    @RequestMapping("/findByWeight")
    public User findByWeight(String weight) {
        User user = new User();
        user.setSex("nan");
        user.setName("张三");
        user.setWeight("qqq");
        return user;
    }
    @RequestMapping("/findByHeight")
    public User findByAge(String  height) {
        User user = new User();
        user.setHeight("123");
        return user;
    }
    @RequestMapping("/findByNum")
    public User findByNum(int num){
        User user = new User();
        user.setNum(99);
        return user;
    }

    @RequestMapping("/findByS")
    public User findByS(int s){
        User user = new User();
        user.setNum(99);
        user.setS(10);
        return user;
    }
}
